<div class="crumb-wrap">
    <div class="crumb-list"> <i class="icon-font"></i>
        <a href="<?=site_url()?>">首页</a>
        <span class="crumb-step">&gt;</span>
        <span class="crumb-name">权限管理</span>
    </div>
</div>
<div class="result-wrap">
        <div class="result-title">
            <div class="result-list">
                <a href="<?=site_url('group/create')?>"><i class="icon-font"></i>新增权限</a>
            </div>
        </div>
        <div class="result-content">
            <table class="result-tab" width="100%">
                <tr>
                    <th>ID</th>
                    <th>标题</th>
                    <th>备注</th>
                    <th>升级金额</th>
                    <th>更新时间</th>
                    <th>操作</th>
                </tr>

                <?php foreach($list as $k => $v):?>
                <tr>
                    <td><?=$v['id']?></td>
                    <td>
                        <a target="_blank" href="<?=site_url('users/index?group='.$v['id'])?>" title="<?=$v['title']?>"><?=$v['title']?></a>
                    </td>
                    <td><?=$v['remark']?></td>
                    <td><?=$v['condition']?></td>
                    <td><?=date('Y-m-d H:i:s',$v['update_time'])?></td>
                    <td>
                        <a class="link-update" href="<?=site_url('group/update?gid='.$v['id'])?>">修改</a>
                        <a class="link-del" href="javascript:;" onclick="group_delete(<?=$v['id']?>)">删除</a>
                    </td>
                </tr>
                <?php endforeach;?>
            </table>
            <div class="list-page"><?=$page?></div>
        </div>
</div>

<script type="text/javascript">
    function group_delete(id){
        layer.confirm('删除之后不可恢复，该权限的所有用户取消为金额最低的权限，是否确定？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post("<?=site_url('group/delete')?>",{gid:id},function(data){
                if(data == 1){
                    layer.alert("操作成功！",{
                        icon:1,
                    },function(){
                        location.reload();
                    });
                }else{
                    layer.alert(data,{
                        icon:2,
                    });
                }
            });
        });
    }
</script>